package cn.jobstart.enums;

/**
 * @author sunke
 * @version 1.0
 * @Description html爬数据类型
 * @date 2023-10-23 17:19
 */
public enum HtmlTypeFleEnum {

    Talent(0,"人才"),
    company(1,"企业");
    private int type;
    private String desc;


    HtmlTypeFleEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public HtmlTypeFleEnum setType(int type) {
        this.type = type;
        return this;
    }

    public String getDesc() {
        return desc;
    }

    public HtmlTypeFleEnum setDesc(String desc) {
        this.desc = desc;
        return this;
    }

    public static String getDescByType(Integer type) {
        if(type==null ){
            type=0;
        }
        for (HtmlTypeFleEnum var : HtmlTypeFleEnum.values()) {
            if (type==var.getType()) {
                return var.getDesc();
            }
        }
        return HtmlTypeFleEnum.values()[0].getDesc();
    }
}
